package com.lange.fileManagement.service;

import com.alibaba.fastjson.JSONObject;
import com.lange.fileManagement.dao.CaptchaDaoImpl;
import com.lange.fileManagement.dao.UserDaoImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class CaptchaService {

    @Autowired
    private CaptchaDaoImpl captchaDao;

    /*添加验证码*/
    public Integer addCaptcha(String value) {
        return captchaDao.addCaptcha(value);
    }

    /*校验验证码*/
    public boolean validataCode(String value) {
        return !captchaDao.getCaptchaByValue(value).isEmpty();
    }
}
